package thread.test1Io;

import java.io.IOException;
import java.io.PipedOutputStream;

/**
 * Created by majian8 on 2019/6/9.
 */
public class PipedOutThread extends Thread {
    PipedOutputStream pos;

    public PipedOutThread(PipedOutputStream pos) {
        this.pos = pos;
    }

    @Override
    public void run() {
        try {
            pos.write("hello world".getBytes());
            pos.close();
        } catch (IOException e){
            e.printStackTrace();
        }
    }
}
